/**
 *	\file AKBasicDrawing.h
 *  
 *  \section desc_sec Description
 *  Description
 *  
 *  \if copyright
 *  	Copyright 2008 Ben Chen. All rights reserved.
 *  \endif
 *  
 *  \section hist_sec Change History:
 *  	-	1/18/08		BC		Created this file
 *  
 *  <hr>
 *  \addtogroup AnimalKingdom
 *  @{
 */

#import "AKPlugIn.h"

enum {
	kAKBasicDrawingOperationAdd = 0,
	kAKBasicDrawingOperationRemove,
	kAKBasicDrawingOperationRemoveAll,
	kAKBasicDrawingOperationMove
};

typedef int AKBasicDrawingOperationType;

AK_EXPORT const NSString *kAKBasicDrawingOperationTypeKey;	///< The corresponding value is of type AKBasicDrawingOperationType.
AK_EXPORT const NSString *kAKBasicDrawingPieceKey;			///< The corresponding value is a AKPiece wrapped in a NSValue, or an array of AKPieces if type is remove all.
AK_EXPORT const NSString *kAKBasicDrawingDestinationKey;	///< The corresponding value is a AKCellIndex wrapped in a NSNumber, or nil if type is not kAKBasicDrawingOperationMove

@protocol AKBasicDrawing;

@interface NSObject (AKBasicDrawingDelegateMethods)
- (void)transaction:(NSString*)transactionName didFinished:(id <AKBasicDrawing>)aDrawer;

- (void)AKBasicDrawingDidRemoveAllPieces;
- (void)AKBasicDrawingDidAddPiece:(AKPiece)aPiece;
- (void)AKBasicDrawingDidMovePiece:(AKPiece)aPiece toCell:(AKCellIndex)dstCell;
- (void)AKBasicDrawingDidRemovePiece:(AKPiece)aPiece;
@end

AK_EXPORT const NSString *AKBasicDrawingDidRemoveAllPiecesNotification;
AK_EXPORT const NSString *AKBasicDrawingDidAddPieceNotification;
AK_EXPORT const NSString *AKBasicDrawingDidMovePieceNotification;
AK_EXPORT const NSString *AKBasicDrawingDidRemovePieceNotification;

@protocol AKBasicDrawing <AKPlugIn>
- (void)removeAllPieces;
- (void)addPiece:(AKPiece)piece;
- (void)movePiece:(AKPiece)piece
		   toCell:(AKCellIndex)dstCell;
- (void)removePiece:(AKPiece)piece;

- (void)beginTransaction:(NSString*)transactionName;	// Raise an exception when a transaction has began already.
- (void)commitTransaction;
@property (readwrite, assign) id delegate;
@end

/** @} */